home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / demos / OpenGL / stonehenge / atmosphere.h < prev    next >
C/C++ Source or Header  |  1996-11-11  |  3KB  |  90 lines

  1. /*
  2.  * (c) Copyright 1993, Silicon Graphics, Inc.
  3.  * ALL RIGHTS RESERVED
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software for
  6.  * any purpose and without fee is hereby granted, provided that the above
  7.  * copyright notice appear in all copies and that both the copyright notice
  8.  * and this permission notice appear in supporting documentation, and that
  9.  * the name of Silicon Graphics, Inc. not be used in advertising
  10.  * or publicity pertaining to distribution of the software without specific,
  11.  * written prior permission.
  12.  *
  13.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  14.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  15.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  16.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  17.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  18.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  19.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  20.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  21.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  22.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  23.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  24.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  25.  *
  26.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND
  27.  * Use, duplication, or disclosure by the Government is subject to
  28.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  29.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  30.  * clause at DFARS 252.227-7013 and/or in similar or successor
  31.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  32.  * Unpublished-- rights reserved under the copyright laws of the
  33.  * United States.  Contractor/manufacturer is Silicon Graphics,
  34.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  35.  *
  36.  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
  37.  */
  38. #ifndef ATMOSPHERE_H
  39. #define ATMOSPHERE_H
  40.  
  41. #ifndef ATMOSPHERE_EXTERN
  42. #define ATMOSPHERE_EXTERN extern
  43. #endif
  44.  
  45. #include "Color.h"
  46. #include "Point.h"
  47.  
  48. const int weather_max_name = 64;
  49. class Weather {
  50.  public:
  51.   Weather();
  52.   Weather(const char *n, GLfloat fd, GLfloat fs = 1, Color fc = white, 
  53.       Color s1 = blue, Color s2 = white,
  54.       GLfloat sb = 1,
  55.       GLenum ls = GL_LIGHT0, GLenum la = GL_LIGHT1);
  56.   ~Weather();
  57.  
  58.   Weather operator=(Weather a);
  59.  
  60.   /* The sun position is used to determine how light / dark it is */
  61.   void apply(Point sun);
  62.   void draw_sky(Point sun);
  63.  
  64.   /* This is how much to blur shadows due to haze or fog */
  65.   GLfloat shadow_blur();
  66.  
  67.   char name[weather_max_name];
  68.  
  69.   GLfloat fog_density;
  70.   Color fog_color;
  71.   /* Fog spread relates the height to the density of the fog -- 1.0
  72.    * leads to uniform fog */
  73.   GLfloat fog_spread;
  74.  
  75.   Color sky_top;
  76.   Color sky_bottom;
  77.  
  78.   GLenum light_sun, light_ambient;
  79.   GLfloat sun_brightness;
  80.  
  81.  private:
  82. };
  83. const int nweathers = 4;
  84. extern Weather weathers[nweathers];
  85. const int def_weather_index = 0;
  86.  
  87. #undef ATMOSPHERE_EXTERN
  88.  
  89. #endif
  90.